﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SGS.Cards;

namespace SGS.Standard.CardSelector
{
    public class CardSelectorMappingItem
    {
        static int dummy = 0;

        public int UniqueID
        {
            get;
            protected set;
        }

        public CardSelectorMappingItem()
        {
            UniqueID = ++dummy;
        }

        public CardSelectorMappingItem(Card targetCard, MappingPrivilege privilege = MappingPrivilege.Hidden,
            MappingType type = MappingType.OwnCard)
        {
            UniqueID = ++dummy;

            this.Privilege = privilege;
            this.MappingType = type;
            this.TargetCard = targetCard;
        }

        public MappingPrivilege Privilege
        {
            get;
            internal set;
        }

        public MappingType MappingType
        {
            get;
            protected set;
        }

        public Card TargetCard
        {
            get;
            protected set;
        }

        public override string ToString()
        {
            switch (Privilege)
            {
                case MappingPrivilege.Public:
                    return string.Format("MappingUniqueID={0}, Type={1}, TargetCard={2}", this.UniqueID, this.MappingType, TargetCard.ToString());
                case MappingPrivilege.Hidden:
                    return string.Format("MappingUniqueID={0}, Type={1}", this.UniqueID, this.MappingType);
                case MappingPrivilege.Invalid:
                default:
                    return string.Format("MappingUniqueID={0}, Type={1}, Invalid, TargetCard={2}", this.UniqueID, this.MappingType, TargetCard.ToString());

                // break;
            }
            // return string.Empty;
        }
    }
}
